package com.education.wisdom.service.impl;

import java.util.List;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.JrMedalMapper;
import com.education.wisdom.pojo.JrMedal;
import com.education.wisdom.service.IJrMedalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 勋章规则 服务层实现
 *
 * @author d
 * @date 2021-08-18
 */
@Service
public class JrMedalServiceImpl implements IJrMedalService {

    @Autowired
    private JrMedalMapper jrMedalMapper;

    /**
     * 查询勋章规则信息
     *
     * @param medalId 勋章规则ID
     * @return 勋章规则信息
     */
    @Override
    public JrMedal selectJrMedalById(Integer medalId) {
        return jrMedalMapper.selectJrMedalById(medalId);
    }

    /**
     * 查询勋章规则列表
     *
     * @param jrMedal 勋章规则信息
     * @return 勋章规则集合
     */
    @Override
    public List<JrMedal> selectJrMedalList(JrMedal jrMedal) {
        return jrMedalMapper.selectJrMedalList(jrMedal);
    }

    /**
     * 新增勋章规则
     *
     * @param jrMedal 勋章规则信息
     * @return 结果
     */
    @Override
    public int insertJrMedal(JrMedal jrMedal) {
        return jrMedalMapper.insertJrMedal(jrMedal);
    }

    /**
     * 修改勋章规则
     *
     * @param jrMedal 勋章规则信息
     * @return 结果
     */
    @Override
    public int updateJrMedal(JrMedal jrMedal) {
        return jrMedalMapper.updateJrMedal(jrMedal);
    }

    /**
     * 删除勋章规则对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJrMedalByIds(String ids) {
        return jrMedalMapper.deleteJrMedalByIds(Convert.toStrArray(ids));
    }
}